//
// Created by yanhai on 2021/11/4.
//

#pragma once

#include <mutex>

#include "utility/hashthread/hash_table_thread.h"
#include "packet.h"

struct Flow: public HashTableThreadBucketNode {
    unsigned int src_addr{0};
    unsigned int dst_addr{0};

    unsigned short src_port{0};
    unsigned short dst_port{0};

    unsigned int proto{0};

    unsigned int count{0};

    unsigned int last_time{0};

    bool CompareValue(HashTableThreadValue *v) override;

    void InitByValue(HashTableThreadValue *v) override;

    bool operator==(const Packet &p) const;
};
